package com.csun.dsms.mapper;

import com.csun.dsms.model.domain.YcDeviceData;
import com.csun.dsms.model.dto.yc.YcDataDto;
import com.csun.dsms.model.dto.yc.YcDeviceQueryDto;
import org.apache.ibatis.annotations.Delete;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface YcDeviceDataMapper extends Mapper<YcDeviceData> {

    //删除上个月的数据
    @Delete("delete from yc_device_data where DATE(created_time) <= DATE(DATE_SUB(NOW(),INTERVAL 30 DAY));")
    void deleteBfDate();

    List<YcDeviceData> queryListWithPage(YcDeviceQueryDto ycDeviceQuery);

    List<YcDataDto> queryRealData(YcDeviceQueryDto dto);

    YcDeviceData queryReal(YcDeviceQueryDto ycDeviceQuery);
}